package com.ruoyi.quartz.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.CdOrderMainMapper;
import com.ruoyi.quartz.domain.CdOrderMain;
import com.ruoyi.quartz.service.ICdOrderMainService;

/**
 * CdOrderMainService业务层处理
 * 
 * @author SYF
 * @date 2025-05-09
 */
@Service
public class CdOrderMainServiceImpl implements ICdOrderMainService 
{
    @Autowired
    private CdOrderMainMapper cdOrderMainMapper;

    /**
     * 查询CdOrderMain
     * 
     * @param fdate CdOrderMain主键
     * @return CdOrderMain
     */
    @Override
    public CdOrderMain selectCdOrderMainByFdate(String fdate)
    {
        return cdOrderMainMapper.selectCdOrderMainByFdate(fdate);
    }

    /**
     * 查询CdOrderMain列表
     * 
     * @param cdOrderMain CdOrderMain
     * @return CdOrderMain
     */
    @Override
    public List<CdOrderMain> selectCdOrderMainList(CdOrderMain cdOrderMain)
    {
        return cdOrderMainMapper.selectCdOrderMainList(cdOrderMain);
    }

    /**
     * 新增CdOrderMain
     * 
     * @param cdOrderMain CdOrderMain
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int insertCdOrderMain(CdOrderMain cdOrderMain)
    {
        return cdOrderMainMapper.insertCdOrderMain(cdOrderMain);
    }

    /**
     * 修改CdOrderMain
     * 
     * @param cdOrderMain CdOrderMain
     * @return 结果
     */
    @Override
    public int updateCdOrderMain(CdOrderMain cdOrderMain)
    {
        return cdOrderMainMapper.updateCdOrderMain(cdOrderMain);
    }

    /**
     * 批量删除CdOrderMain
     * 
     * @param fdates 需要删除的CdOrderMain主键
     * @return 结果
     */
    @Override
    public int deleteCdOrderMainByFdates(String[] fdates)
    {
        return cdOrderMainMapper.deleteCdOrderMainByFdates(fdates);
    }

    /**
     * 删除CdOrderMain信息
     * 
     * @param fdate CdOrderMain主键
     * @return 结果
     */
    @Override
    public int deleteCdOrderMainByFdate(String fdate)
    {
        return cdOrderMainMapper.deleteCdOrderMainByFdate(fdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectCdOrderMainData(){
        return cdOrderMainMapper.selectCdOrderMainData();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public int clearCdOrderMain(){
        return cdOrderMainMapper.clearCdOrderMain();
    }
}
